import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("rrz_goods_attribute", { schema: "rrzcms" })
export class RrzGoodsAttribute {
  @PrimaryGeneratedColumn({
    type: "int",
    name: "id",
    comment: "属性id",
    unsigned: true,
  })
  id: number;

  @Column("varchar", { name: "name", comment: "属性名称", length: 60 })
  name: string;

  @Column("tinyint", {
    name: "is_filter",
    comment: "是否应用于条件筛选",
    unsigned: true,
    default: () => "'0'",
  })
  isFilter: number;

  @Column("tinyint", {
    name: "type",
    comment: "类型（0 单行文本框 1下拉式列表 2多行文本框）",
    unsigned: true,
    default: () => "'0'",
  })
  type: number;

  @Column("text", { name: "values", nullable: true, comment: "属性值集合" })
  values: string | null;

  @Column("tinyint", {
    name: "sort",
    comment: "属性排序",
    unsigned: true,
    default: () => "'100'",
  })
  sort: number;
}
